using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace Sedna.Core.Persistence.Hql
{
    public class HqlClause
    {
        protected IList list = new ArrayList(5);
                
        public HqlClause Add(string token)
        {
            list.Add(token);
            return this;
        }
        
        public void Build(string verb, StringBuilder sb)
        {
            if (list.Count==0)
            {
                return;
            }
            sb.Append(' ').Append(verb).Append(' ');
            foreach (string str in list)
            {
                sb.Append(str).Append(',');
            }
            sb.Remove(sb.Length - 1, 1);
        }
    }
}
